﻿Public Class frmStaffManagment

    Private Sub frmStaffManagment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.WindowState = FormWindowState.Maximized
        Connect()
        Load1FieldToCombo("SELECT  DepartmentName FROM tbl_departments", cboDept)

    End Sub

    Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click
        Dim SQL As String
        SQL = "SELECT tbl_staffdetail.StaffID, tbl_staffs.KName, tbl_staffs.LName, tbl_staffs.DOB, tbl_staffs.Gender, tbl_staffs.Province, tbl_staffs.Contact, tbl_staffs.Tel, tbl_departments.DepartmentName, tbl_staffdetail.Skill " & _
        " FROM tbl_staffs INNER JOIN (tbl_departments INNER JOIN tbl_staffdetail ON tbl_departments.DeptID = tbl_staffdetail.DepartmentID) ON tbl_staffs.StaffID = tbl_staffdetail.StaffID  WHERE tbl_departments.DepartmentName='" & Trim(Me.cboDept.Text) & "' ORDER BY tbl_staffs.StaffID"


        LoadDataToLV(SQL, Me.ListView1)


    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        frmAddStaffs.Show()
    End Sub
End Class